package com.aco.party.common.job;
//package com.icss.background.common.job;
//
//import org.apache.commons.lang.StringUtils;
//import org.quartz.Job;
//import org.quartz.JobDataMap;
//import org.quartz.JobExecutionContext;
//import org.quartz.JobExecutionException;
//import org.slf4j.Logger;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import com.icss.background.common.job.SchedulerJob;
//import com.icss.background.common.log.LoggerManager;
//import com.icss.background.common.util.DebugUtils;
//
///**
// * <P>Title: SchedulerJobProcessor</P>
// * <P>Description: 后台任务的总入口类</P>
// * <P>Copyright: Copyright (c) 2013 </P>
// * <P>Company: icss </P>
// * 
// * @author tangruihua
// * @version 1.0
// * @create 2012-2-2
// * @history
// */
//@SuppressWarnings({ "unused" })
//public class SchedulerJobProcessor implements Job {
//	private static final Logger logger = LoggerManager.getLogger(SchedulerJobProcessor.class);
//	// 具体的业务接口类
//	@Autowired
//	private SchedulerJob schedulerJob;
//
//	/**
//	 * 业务接口类的私有方法调用
//	 * 
//	 * @param scheduleName
//	 *            业务类名，用此取业务bean
//	 * @param taskParam
//	 *            参数列表
//	 * @throws ClassNotFoundException 
//	 */
//	private void process(String scheduleName, Object taskParam) {
//		if (logger.isDebugEnabled()) {
//			logger.debug("进入ScheduleJobProcessor类process方法！");
//			logger.debug("===打印入口参数：scheduleName" + scheduleName);
//			DebugUtils.printObj(taskParam);
//		}
//		try {
//			schedulerJob = SchedulerJobFactory.getInstance().getSchedule(scheduleName);
//			Object retval = schedulerJob.excuteTask(taskParam);
//			logger.debug("取到Schedule的类Schedule=======" + schedulerJob);
//		} catch (Exception e) {
//			logger.error("process error" + e.getMessage(), e);
//		}
//		if (logger.isDebugEnabled()) {
//			logger.debug("结束ScheduleJobProcessor类process方法！");
//		}
//	}
//
//	/**
//	 * 定时任务具体执行的接口方法，必须在此实现job的接口
//	 */
//	public void execute(JobExecutionContext arg0) throws JobExecutionException {
//		logger.debug("开始定时任务..." + arg0.getJobDetail().getFullName());
//		JobDataMap dataMap = arg0.getJobDetail().getJobDataMap();
//		String scheduleName = dataMap.getString("serviceName");
//		if (StringUtils.isEmpty(scheduleName)) {
//			scheduleName = arg0.getJobDetail().getName();
//		}
//		logger.debug("===配置的scheduleName===" + scheduleName);
//		process(scheduleName, dataMap);
//	}
//}
